using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using retrofit;
using interfaces;

namespace main
{
	class Program
	{
		static void Main(string[] args)
		{
			Test test = new Test();

			test.testSimulateResult();

			//test.testSimulateResult();

			//test.measureQueryTest();

			//test.runTest();

			//test.runTest();
		}

		/// <summary>
		/// print array function simply combining all the outputs in one line.
		/// <param name="arr">the input array</param>
		/// </summary>
		public static void printArray(double[] arr)
		{
			string line = "Total: " + arr.Length + " -- ";

			for (int j = 0; j < (int)arr.Length; ++j)
			{
				line = line + arr[j] + "; ";
			}
			Console.WriteLine(line);
		}

		/// <summary>
		/// overloading, print array function simply combining all the outputs in one line.
		/// <param name="arr">the input array</param>
		/// </summary>
		public static void printArray(int[] arr)
		{
			string line = "Total: " + arr.Length + " -- ";

			for (int j = 0; j < (int)arr.Length; ++j)
			{
				line = line + arr[j] + "; ";
			}
			Console.WriteLine(line);
		}

		/// <summary>
		/// overloading, print array function simply combining all the outputs in one line.
		/// <param name="arr">the input array</param>
		/// </summary>
		public static void printArray(string[] arr)
		{
			string line = "Total: " + arr.Length + " -- ";

			for (int j = 0; j < (int)arr.Length; ++j)
			{
				line = line + arr[j] + "; ";
			}
			Console.WriteLine(line);
		}

		public static void writeToFile(double[] arr, string filename)
		{
			if (!File.Exists(filename))
			{
				// Create a file to write to.
				using (StreamWriter sw = File.CreateText(filename))
				{
					string line;
					for (int i = 0; i < arr.Length; ++i)
					{
						line = Keyword.m_energy_cat[i] + ",";
						line = line + arr[i];
						sw.WriteLine(line);
					}
				}
			}
		}
	}
}
